home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 16647 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  8.1 KB

  1. Path: news.internex.net.au!usenet
  2. From: sultan@connexus.apana.org.au (Jon Hornstein)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Would/Won't you use a garbage collector?
  5. Date: Fri, 12 Apr 1996 09:15:26 GMT
  6. Organization: connexus.apana.org.au
  7. Message-ID: <4kjbeq$36u@preeda.internex.net.au>
  8. References: <4kamie$e4d@dfw-ixnews3.ix.netcom.com>
  9. NNTP-Posting-Host: dialin-4.internex.net.au
  10. X-Newsreader: Forte Free Agent 1.0.82
  11.  
  12. I don't use Garbage Collector(GC) but I would love to use them.
  13.  
  14. Why because...
  15.  
  16. Basically I want it part of the "standard" function library or even
  17. integrated into the language.
  18.  
  19. Generally one memory leak or g-d forbid a dandling pointer in
  20. production code would more than justify the expense of buying 3rd
  21. party software to facilitate GC.
  22.  
  23. GC must be flexible ie TOTALLY configurable due to the different
  24. environments it will execute on, and be very efficient! 
  25.  
  26. The general C/C++ programming model assumes a certain paradyn ie.
  27. stack based, separated Data and address space. I've written programs
  28. that assume no explicit heap (embedded controllers) or the old "hello
  29. world\n" program. With no heap I generally don't care about GC.
  30.  
  31. I know different software houses produce GC packages targetted for
  32. particular platforms but because I write code for
  33. DOS\OS/2\Solaris\Embedded controllers  I would like to take the GC
  34. package and that hard learned experience across to all these
  35. platforms.
  36.  
  37.  
  38. I hate having to allocate and deallocate heap objects. So called
  39. "smart" pointers or "reference" counting can releave some of the
  40. tedium but are clearly not the only answer, they're only my stopgap
  41. measure to releave some of the coding "burden". 
  42.  
  43. Strategies for GC have been around for 30 years yet not incorporated
  44. into C/C++ standards. 
  45.  
  46. I've read quotes in ads. with astounding claims re. memory leaks fixes
  47. and performance/productivity enhancements. 
  48.  
  49. Let us say I believe the ads, then you can assume I'm crying out to
  50. ANSI standards comittees or compiler vendors well what are we waiting
  51. for. 
  52.  
  53. I have't the time to implement my own version of GC nor should an
  54. application programmer be expected to produce such a facility. Such a
  55. facillity is not trivial to implement and perhaps would introduce more
  56. bugs in the systems I write.
  57.  
  58. When vendors like for example Rogue Wave, or ObjectSpace lend there
  59. support to GC then I think GC will become a reality for me. 
  60.  
  61. Please indicate "packages" I can use for GC commercial or otherwise
  62. because I am very interested in improving my accuracy and productivity
  63. not for this project, but for the next!
  64.  
  65. Please mail to me where I can get GC packages. Thanks in advance!
  66.  
  67.  
  68. Yours Jon
  69.  
  70.  
  71. giuliano@ix.netcom.com(Giuliano Carlini) wrote:
  72.  
  73. >I'm a long time proponent of using garbage collection in C and C++
  74. >programs, and I'm curious:
  75. >    - How many others are there?
  76. >    - Why don't most C/C++ programmers use it?
  77. >I'm particularly interested in finding out why most C/C++ don't use it.
  78. >While I have my own theories - which I'll describe below - I'm
  79. >interested
  80. >in finding out more directly from those who are against it. I've spent
  81. >a
  82. >good part of the past 4 years trying to convince people to use it, and
  83. >I've got a handle on why the small group of people I associate with are
  84. >not using it, but I'd like to find out more about why the C/C++
  85. >community
  86. >as a whole does not.
  87.  
  88. >I hope that with this information, I'll be able to perfect a more
  89. >convincing presentation for why the default should be to use garbage
  90. >collection, and for why explicit calls to free/delete should be used
  91. >only
  92. >in the rare cases for which garbage collection is inappropriate.
  93.  
  94. >What follows is my belief for why garbage collection is so little used.
  95. >Feel free to respond to anything I say below, but please, first respond
  96. >to the questions above. I believe that most people don't use garbage
  97. >collection because either they:
  98. >    - don't know what it is
  99. >    - don't know it can be used with C/C++.
  100. >    - are misinformation
  101. >    - are biased against it by the C/C++ culture
  102. >In my experience, most C/C++ programmers either don't know what garbage
  103. >collection is, or don't know that it can be used with C/C++. After all,
  104. >no major C/C++ compiler includes a garbage collector. At least, as far
  105. >as I know. I hope I'm wrong, and that someone can correct me. But even
  106. >after, I tell them what it is, and that it can be used with C++, almost
  107. >everyone still rejects it. 
  108.  
  109. >At first, most offer technical reasons for rejecting it. Almost all are
  110. >based on misinformation, since garbage collection is usable and
  111. >benificial
  112. >for the vast majority of systems. The most often mentioned is thatFrom: giuliano@ix.netcom.com(Giuliano Carlini)
  113. >Newsgroups: comp.lang.c++
  114. >Subject: Would/Won't you use a garbage collector?
  115.  
  116. >I'm a long time proponent of using garbage collection in C and C++
  117. >programs, and I'm curious:
  118. >    - How many others are there?
  119. >    - Why don't most C/C++ programmers use it?
  120. >I'm particularly interested in finding out why most C/C++ don't use it.
  121. >While I have my own theories - which I'll describe below - I'm
  122. >interested
  123. >in finding out more directly from those who are against it. I've spent
  124. >a
  125. >good part of the past 4 years trying to convince people to use it, and
  126. >I've got a handle on why the small group of people I associate with are
  127. >not using it, but I'd like to find out more about why the C/C++
  128. >community
  129. >as a whole does not.
  130.  
  131. >I hope that with this information, I'll be able to perfect a more
  132. >convincing presentation for why the default should be to use garbage
  133. >collection, and for why explicit calls to free/delete should be used
  134. >only
  135. >in the rare cases for which garbage collection is inappropriate.
  136.  
  137. >What follows is my belief for why garbage collection is so little used.
  138. >Feel free to respond to anything I say below, but please, first respond
  139. >to the questions above. I believe that most people don't use garbage
  140. >collection because either they:
  141. >    - don't know what it is
  142. >    - don't know it can be used with C/C++.
  143. >    - are misinformation
  144. >    - are biased against it by the C/C++ culture
  145. >In my experience, most C/C++ programmers either don't know what garbage
  146. >collection is, or don't know that it can be used with C/C++. After all,
  147. >no major C/C++ compiler includes a garbage collector. At least, as far
  148. >as I know. I hope I'm wrong, and that someone can correct me. But even
  149. >after, I tell them what it is, and that it can be used with C++, almost
  150. >everyone still rejects it. 
  151.  
  152. >At first, most offer technical reasons for rejecting it. Almost all are
  153. >based on misinformation, since garbage collection is usable and
  154. >benificial
  155. >for the vast majority of systems. The most often mentioned is thatalthough
  156. >I sure try. The crux of cultural reason against garbage collection is
  157. >that
  158. >relying on a garbage collector is "sloppy". The "Code talk" note in the
  159. >January Byte is a great example of this thinking. This sort of C/C++
  160. >programmer believes that it is just wrong to not explicitly call
  161. >delete.
  162. >That if you don't, your an undisciplined hack. That if you don't,
  163. >you've
  164. >turned to the dark side and surely will come to a bad end.
  165.  
  166. >I'm not sure how to address this. My current argument seems to get them
  167. >thinking, but isn't immediately convincing. Anyone have any ideas on a
  168. >better approach. Or perhaps on a better presentation. My argument is
  169. >that
  170. >computers are very good at mechanistic, repetitive tasks. And that
  171. >people
  172. >are usually pretty bad at them; being mechanistic and repetitive, these
  173. >tasks are rather boring, which means that our attention often strays.
  174. >People
  175. >routinely turn over such tasks to computers. For example, bookkeeping
  176. >or
  177. >inventory control. And what else is memory deallocation but a sort of
  178. >bookkeeping or inventory control. It's just that rather than being for
  179. >a resource outside of the computer it is for one inside.
  180.  
  181. >For anyone who may be wondering, I believe that we should use garbage
  182. >collection because:
  183. >    - It vastly decreases the number of bugs in programs which use
  184. >it.
  185. >    - It vastly decreases the time to complete programs which use
  186. >it.
  187. >    - It vastly increases the understandability, reuseability,
  188. >        extensability, and maintainability of programs which use
  189. >it.
  190.  
  191. >So, do you use garbage collection in your C/C++ programs, and if not,
  192. >why not?
  193.  
  194. >giuliano
  195.  
  196.  
  197.